UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EFqUq8rQeJjBbmq0T3ZEA9yS9YIRvJd5PdcVeOKMzOk='
WHERE
key_id = '293c9610f00437b022c44d464442cb490a15afdf163168ba2dbe159707de7521'
AND (
token = 'EFqUq8rQeJjBbmq0T3ZEA9yS9YIRvJd5PdcVeOKMzOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)