UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uxwBt5cgzVhBWboY3nnPxkplOYlYRiNknUWecLawo8M=' 
WHERE 
  key_id = 'c75b4f38dd423c59d9562a33dc200885a2cb4b0e3a5ecdb8e3d09c4bd96beeba' 
  AND (
    token = 'uxwBt5cgzVhBWboY3nnPxkplOYlYRiNknUWecLawo8M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00218