UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YcIGEKbbkdpI+CCpYFcJsdMl3GMYSHXavZ0Oo9Qv4hU='
WHERE
key_id = 'a83772159b524db85a41151871f02518660cebb3a8db8e5985df36d088eba5ee'
AND (
token = 'YcIGEKbbkdpI+CCpYFcJsdMl3GMYSHXavZ0Oo9Qv4hU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)