UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GLeBcmIHNgIBbeObVwQvdhHmfEruzkpPVirAI0wgGGg='
WHERE
key_id = 'a5216e1bc1fa7285211b62431711edfbe5f022dd70cd8bcf86d96d04d40cf41d'
AND (
token = 'GLeBcmIHNgIBbeObVwQvdhHmfEruzkpPVirAI0wgGGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)