UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yx5OwHaaJB9xqJf4k3F2/H1pt22QvP3httA2xhRLbpg=' 
WHERE 
  key_id = '12267231c40f8652fa2837945119f9f26221c52ae43dad4ce4e97c88cc80543b' 
  AND (
    token = 'yx5OwHaaJB9xqJf4k3F2/H1pt22QvP3httA2xhRLbpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048