UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jb3PTrldJdLh/fAFvfCP24bzCjIJh35K8mMkE1DTy/c=' 
WHERE 
  key_id = '7f285a1bea96edb4353daadf9721bf44d987c7dd4199e5ece9ced676f330b136' 
  AND (
    token = 'jb3PTrldJdLh/fAFvfCP24bzCjIJh35K8mMkE1DTy/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021