UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U+coXbZObQ03kW4EYHj1bru2+HwV7KOje0IBlovz5oQ=' 
WHERE 
  key_id = '55c4bf1af29ea75e25a219ba71321cc0f36b31ae64b0845a275c9f5d01d01aa9' 
  AND (
    token = 'U+coXbZObQ03kW4EYHj1bru2+HwV7KOje0IBlovz5oQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017