UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/RG78satlXMyj4QjbQ75ArPAIyqpHfD5gZuOb37LQ7Q='
WHERE
key_id = '57eefa803ee1dcda05a71dc1ffa539754ef7e4d760f931c2829c551ae52b79eb'
AND (
token = '/RG78satlXMyj4QjbQ75ArPAIyqpHfD5gZuOb37LQ7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)