UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CWn6mEWaUwlHw6a9bt0jrdnNNq4iPI4Eih6h0PY6nwg='
WHERE
key_id = 'fffc7cea98ab15b6e8834e2fdf9fba16a05a9eeb3097d7b569e6648bcdd88afb'
AND (
token = 'CWn6mEWaUwlHw6a9bt0jrdnNNq4iPI4Eih6h0PY6nwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)