UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H7oVjhAO8NybYLiZ/V6u1mGZhuiBP9s7vUyijsJPX08='
WHERE
key_id = 'c1ab3e44dfc64f0f68b1e751eba5dbc51c32b73effa05bf63fca9db6b99bc7eb'
AND (
token = 'H7oVjhAO8NybYLiZ/V6u1mGZhuiBP9s7vUyijsJPX08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)