UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9NP4U/jjXZJNtAd8s5XpD7tKb2zGusxB1FCKftAznuM=' 
WHERE 
  key_id = 'c1698c708f78b5e8c40c3a0f1d6db7beb051dc4eab9d78b1eeac76dd216796d6' 
  AND (
    token = '9NP4U/jjXZJNtAd8s5XpD7tKb2zGusxB1FCKftAznuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028