UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6yRPcL+Vy6Tr1bXi+eNq3Mf9+ZbYue3MirZANwFsLbo='
WHERE
key_id = 'b29d27c661717de01608470755f4929348017ada5c688a042c60560d4f59fd63'
AND (
token = '6yRPcL+Vy6Tr1bXi+eNq3Mf9+ZbYue3MirZANwFsLbo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)