UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Q/N19aR61FF20z/3l9XtbmlX+F7CUMqREs0XHE+8eY='
WHERE
key_id = 'e3a666faa6e0965905413d5d6a93d2a667eeb7dffc406cbd1cf3d72a21274b9b'
AND (
token = '4Q/N19aR61FF20z/3l9XtbmlX+F7CUMqREs0XHE+8eY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)