UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D7Mz6TG15dDKtkpQWAt2iexWSBoSrKEeKuUr0SKjD74='
WHERE
key_id = '85a8b1f66aacf38703ffaf73ab3d8c9555b3f37def0fbd7cbe63259adec3e4f6'
AND (
token = 'D7Mz6TG15dDKtkpQWAt2iexWSBoSrKEeKuUr0SKjD74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)