UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cnvKwxMK3PCKE38E/oZeAiB/E45wOEyWZRQK9MYzrrg=' 
WHERE 
  key_id = 'ba7fd9595dc211d20d4817d1a31bf748b426cee5d6b9c5b89468c77a52a9097f' 
  AND (
    token = 'cnvKwxMK3PCKE38E/oZeAiB/E45wOEyWZRQK9MYzrrg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032