UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AjKdR+ZluJ1S1YFBXz8OJXO1Bm0cBt3Vu3+k4EyhmqI='
WHERE
key_id = '273f3a4eedbc546a7ead72973806fb2d79c3c63845149c427f544ddfe71af6ad'
AND (
token = 'AjKdR+ZluJ1S1YFBXz8OJXO1Bm0cBt3Vu3+k4EyhmqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)