UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8WgO7L5BG1qQcwwElUHW4WGxS2kP9XfQo4RRmWLPrV8='
WHERE
key_id = 'e115dc3e4f0fbc1e515553b89a486de4fe7b5672b19b1380aaf33576c9322654'
AND (
token = '8WgO7L5BG1qQcwwElUHW4WGxS2kP9XfQo4RRmWLPrV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)