UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/gfmCV+YXV5ZOxBhygXdXssJIsBnuUC1QzOyQhoshW8='
WHERE
key_id = '3298effb6d9fa4b34c78b48c01065eb25fbb8edef38cdb7da3339f6ac87694f2'
AND (
token = '/gfmCV+YXV5ZOxBhygXdXssJIsBnuUC1QzOyQhoshW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)