UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/jBhyMwLpgT7h9+bqTODKxZSMsYeffYkXAJWIm9ivMQ='
WHERE
key_id = 'e220263c13e2ff9680add631a2d894faa1b13512dda2d70ef652c38c9c3773a4'
AND (
token = '/jBhyMwLpgT7h9+bqTODKxZSMsYeffYkXAJWIm9ivMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)