UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g3yOUrXM3Wxi/reR5F705XpkZZ8iD8KtcIQVOjv46xw=' 
WHERE 
  key_id = 'fc323b9eb7d213d4d000ca4c47237eedfebf81a379a32665b912c32cf3fe3b0f' 
  AND (
    token = 'g3yOUrXM3Wxi/reR5F705XpkZZ8iD8KtcIQVOjv46xw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029