UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f3E9+CLcBDE/+acP1rgi2RzZnbofW0iRtYzEnJIGVTI='
WHERE
key_id = '441045684cb02aecfe25ed8e208eedd4aea4c3824aae247273e9d4df49d7ebe3'
AND (
token = 'f3E9+CLcBDE/+acP1rgi2RzZnbofW0iRtYzEnJIGVTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)