UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iYwjf+TDp6btdQhhzjD2dZnQji/4f1itLqB2FeQb5iI=' 
WHERE 
  key_id = '7e693bcc672ba678fbefe07a13721ca104eae7bee533352a51046afd07070f0f' 
  AND (
    token = 'iYwjf+TDp6btdQhhzjD2dZnQji/4f1itLqB2FeQb5iI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041