UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UVeAsH9+ItX0l2BghptehWv/Tlg0ebjbwSxr34ptp5Y='
WHERE
key_id = 'b38f5e2d1b28e32b9a3c88c67a77cefae3c91b5804acbee03d206bdbb07d1f57'
AND (
token = 'UVeAsH9+ItX0l2BghptehWv/Tlg0ebjbwSxr34ptp5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)