UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B92nYU6bXt0XVUCk88/22LMzt7JLA9pXmpZWA+PYfKA=' 
WHERE 
  key_id = '55ce6c749223831527b63f81c8370e6a933a023915062e641010845c43399739' 
  AND (
    token = 'B92nYU6bXt0XVUCk88/22LMzt7JLA9pXmpZWA+PYfKA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053