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

Query time 0.00035