UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/em2hjBUjpDmPMe5zN16Phh7Sc/R+/G8WnGujpiat74='
WHERE
key_id = '9f34ab49b4bfcde900696845fafe6b4e3fed5192f128b51ba0393627c8ce2917'
AND (
token = '/em2hjBUjpDmPMe5zN16Phh7Sc/R+/G8WnGujpiat74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)