UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'goVn9rhm/RsnBFNY2OkN6bPcbH80gw7fvegjw4UIC+U='
WHERE
key_id = 'a5801aa2f533a279656c025cec0ec700c22ee8618d948e303613d938a2e6cfe2'
AND (
token = 'goVn9rhm/RsnBFNY2OkN6bPcbH80gw7fvegjw4UIC+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)