UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wOCH6uYW0SCJMzYtS1JUUguMTDtwMeHIeHHPsybjzCU='
WHERE
key_id = 'c71115088a2f90f3d1b1e26ddaa739f319511b26152838016db933c906606a0e'
AND (
token = 'wOCH6uYW0SCJMzYtS1JUUguMTDtwMeHIeHHPsybjzCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)