UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EOJ8aZHtRiCLJrX9HHS6qecZJV35QwDOnEbDs06wvoc='
WHERE
key_id = '7adc63acc1682fcfbfcd2233c55875cc0ff87a9fc8f00335814f4e7ab115dc6e'
AND (
token = 'EOJ8aZHtRiCLJrX9HHS6qecZJV35QwDOnEbDs06wvoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)