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