UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z/74v5lGvAhDZLB1dVR1fObrgE5UwxDmsZOcNkBO7jQ='
WHERE
key_id = 'f4bc441e05abaa6afe8ab92a11199c1d2626e7c2ccb7e099a6cf7f81e5e79bdc'
AND (
token = 'Z/74v5lGvAhDZLB1dVR1fObrgE5UwxDmsZOcNkBO7jQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)